<template>
  <div id="forget_container">
    <div class="forget-wrap">
      <Return title="支付订单"></Return>
        <div class="text-center color-white lh-40" style="text-align: center;color:#fff">
        <h4><strong>订单号</strong></h4>
        <p style="margin-top: 15px">{{order_id}}</p>
        </div>
        <div class="blank-40"></div>
        <div>
        <el-button type="warning" round class="button-block" style="width: 100%;margin-top: 30px"
            @click="getPayStatus"><strong>去支付</strong></el-button
        >
        </div>
        <div class="blank-20"></div>
        <div>
        <el-button type="primary" round class="button-block" style="width: 100%;margin-top: 30px" @click="getPayStatus"><strong>完成支付</strong></el-button>
        </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "PayStatus",
  components: {},
  data() {
    return {
      timer: null,
      order_id: this.$route.query.order_id
    };
  },
  mounted() {
    this.getPayStatus()
  },
  methods: {
    // 获取订单状态
    async getPayStatus() {
        let result = await this.$API.order.orderStatus({order_id: this.order_id})
        // if (result.code === 200) {
        //     if (result.order_status === 'success') {
        //         this.$router.replace({name: 'PayResult', query: {status: result.order_status}})
        //     }
        // }
        this.$router.replace({name: 'PayResult', query: {status: result.order_status}})
    }
  },
};
</script>
<style lang="scss">
#forget_container {
  z-index: 2;
  position: absolute;
  right: 0;
  top: 0;
  width: 408px;
  height: 100%;
  overflow: hidden;
  background-color: #34393f;
  .forget-wrap {
    width: 348px;
    margin: auto;
  }
}
</style>
